package cn.smbms.bean.vo;

import java.io.Serializable;

public class SysRoleVo implements Serializable{

	private static final long serialVersionUID = 5263289596810114455L;
	private String name;		//名称
	private String beginDate;	//开始时间
	private String endDate;		//结束时间
	private Integer pageRows=3;		//每页的行数
	private Integer pageIndex =1;	//第几页

	private Integer totalPages;	//总页数
	public Integer getTotalPages() {
		int count;
		if (this.totalPages % pageRows != 0) {
			count = (int)this.totalPages / pageRows + 1;
		} else {
			count = (int)this.totalPages / pageRows;
		}
		return count;
	}
	public void setTotalPages(Integer totalPages) {
		this.totalPages = totalPages;
	}
	
	private String msg;	//提示信息
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public String getBeginDate() {
		return beginDate;
	}
	public void setBeginDate(String beginDate) {
		this.beginDate = beginDate;
	}
	
	public String getEndDate() {
		return endDate;
	}
	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}
	
	public Integer getPageRows() {
		return pageRows;
	}
	public void setPageRows(Integer pageRows) {
		if(null==pageRows||pageRows<=0){
			pageRows = 2;
		}
		this.pageRows = pageRows;
	}
	
	public Integer getPageIndex() {
		return pageIndex;
	}
	public void setPageIndex(Integer pageIndex) {
		if(null==pageIndex||pageIndex<=0){
			pageIndex = 1;
		}
		this.pageIndex = pageIndex;
	}
	
	public Integer getBegin(){
		return (pageIndex-1)*pageRows;
	}
}
